home *** CD-ROM | disk | FTP | other *** search
- #define kVisible false
- #define kMoveToFront (WindowPtr)-1L
- #define kNoGoAway false
- #define kNilRefCon 0L
- #define kPascalString "\pAll applaud the strongly-jawed"
- #define kFontSize 12
- #define kBottomOffset 7
- #define kLeftOffset 7
-
- void ToolBoxInit( void );
- WindowPtr WindowInit( void );
-
- /****************** main ************/
- main()
- {
- Rect shapeRect;
- WindowPtr window;
-
- ToolBoxInit();
- window = WindowInit();
-
- shapeRect = window->portRect;
-
- InsetRect( &shapeRect, 5, 5 );
- FrameRect( &shapeRect );
-
- InsetRect( &shapeRect, 2, 2 );
- FrameRect( &shapeRect );
-
- TextFont( monaco );
- TextSize( kFontSize );
- MoveTo( shapeRect.left + kLeftOffset,
- shapeRect.bottom - kBottomOffset );
- DrawString( kPascalString );
-
- while ( ! Button() ) ;
- }
-
- /****************** ToolBoxInit ***********/
- void ToolBoxInit( void )
- {
- InitGraf( &thePort );
- InitFonts();
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs( nil );
- InitCursor();
- }
-
- /****************** WindowInit *************/
- WindowPtr WindowInit( void )
- {
- WindowPtr window;
- Rect windowRect;
-
- SetRect( &windowRect, 20, 40, 260, 74 );
-
- window = NewWindow( nil, &windowRect, "\pBox o’ Text",
- kVisible, documentProc, kMoveToFront,
- kNoGoAway, kNilRefCon );
-
- if ( window == nil )
- {
- SysBeep( 10 ); /* Couldn’t create a window!!! */
- ExitToShell();
- }
-
- ShowWindow( window );
- SetPort( window );
-
- return( window );
- }
-